﻿using DM_Sqlite.MappingClass;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DM_Sqlite.MappingClassConfig
{
    internal class dm_sysautority_config : IEntityTypeConfiguration<dm_sysauthority>
    {
        public void Configure(EntityTypeBuilder<dm_sysauthority> builder)
        {
          
            builder.ToTable("dm_sysauthority");
            builder.HasKey(b => b.key);
            builder.Property(a => a.loginname).HasMaxLength(64).IsRequired();
            builder.Property(a => a.password).HasMaxLength(64).IsRequired();
            builder.Property(a => a.authoritykey).HasColumnType("tinyint(1)").IsRequired();
            builder.Property(a => a.avatarpath).HasMaxLength(255).IsRequired();


        }
    }
}
